# source files

SRC = main.cpp \
      testGList.cpp \
      testGTree.cpp \
      testLogger.cpp \
      testNameFile.cpp \
      testLZ77.cpp \
      testUtil.cpp \
      zipwritertest.cpp

OBJ = $(patsubst %.cpp,obj/%.o,$(SRC))

OUT = test

#include directories
INCLUDES = -I.\
           -Ithird-party/src \
           -I../src/glist \
           -I../src/gtree \
	   -I../src \
	   -I../src/log \
	   -I../src/zip \
#library paths
LIBS = -L/user/local/lib -lm \
       -Lthird-party/lib \
       -lUnitTest++ \
       -L../src \
       -ljamerzip

#Compiler flags
CCFLAGS = -g
LDFLAGS = -g

#compiler
CCC = g++

default: $(OUT)

$(OBJ): | obj

obj:
	@echo creating objects directory $@
	@mkdir -p $@

obj/%.o : %.cpp
	$(CCC) $(INCLUDES) $(CCFLAGS) -c $< -o $@

#archive the library
$(OUT):$(OBJ)
	$(CCC) -o $(OUT) $(OBJ) $(LIBS)

clean:
	rm -f $(OBJ) $(OUT)
	rm -rf obj
